Changing the type out from under an existing special remote exposes the
existing config to something that may interpret it wildly differently. As
seen in the bug report, this can even result in behavior that makes
git-annex say it's buggy. So prevent the user from doing this. --sameas is
the better way.
Sponsored-by: Kevin Mueller
and a repository in the directory got removed.
* Added annex.assistant.allowunlocked config.
* Add git-remote-p2p-annex and git-remote-tor-annex to standalone builds.
+ * enableremote: Disallow using type= to attempt to change the type of an
+ existing remote.
-- Joey Hess <id@joeyh.name> Fri, 29 Aug 2025 12:34:06 -0400
start o (name:rest) = go =<< filter matchingname <$> Annex.getGitRemotes
where
matchingname r = Git.remoteName r == Just name
- go [] = deadLast name $
- startSpecialRemote o name (Logs.Remote.keyValToConfig Proposed rest)
+ go [] = deadLast name $
+ let config = Logs.Remote.keyValToConfig Proposed rest
+ in case M.lookup SpecialRemote.typeField config of
+ Nothing -> startSpecialRemote o name config
+ Just _ -> giveup "Cannot change type= of existing special remote. Instead, use: git-annex initremote --sameas"
go (r:_)
| not (null rest) = go []
| otherwise = do
### Have you had any luck using git-annex before? (Sometimes we get tired of reading bug reports all day and a lil' positive end note does wonders)
I use git-annex for "everything". I have somewhere along the lines of 14TiB stored in various git-annex repositories, synced in various degrees to anywhere between 3 and 10 hosts, with repos dating back to 2012. It's awesome.
+
+> [[fixed|done]] the git-annex bug by providing a better error message when
+> this is attempted. --[[Joey]]